<!doctype html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<meta name="viewport"
			content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="../css/mui.css" rel="stylesheet" />
		<link href="../css/iconfont.css" rel="stylesheet" />
		<link href="../css/iconfont2.css" rel="stylesheet" />
		<style>
			.mui-bar-tab .mui-tab-item.mui-active {
				color: #5eb2fb;
			}
		</style>
	</head>

	<body>
<!--  -->
		<!--  -->
		<nav class="mui-bar mui-bar-tab myfooter">
			<a class="mui-tab-item mui-active" id="btn" href="service.html">
				<span class="mui-icon mui-icon-home"></span>
				<span class="mui-tab-label">服务</span>
			</a>
			<a class="mui-tab-item" href="person.html">
				<span class="mui-icon mui-icon-person"></span>
				<span class="mui-tab-label">我的</span>
			</a>
		</nav>

		<script src="../js/mui.js"></script>
		<script src="../js/jquery.min.js"></script>
		<script type="text/javascript">
			
			var subpage = ["service.html", "person.html"];

			mui.plusReady(function() {
				var currentWebview = plus.webview.currentWebview();
				console.log(currentWebview)
				
				for (var i = 0; i < subpage.length; i++) {
					var style = {
						top: "0px",
						bottom: "50px"
					};
					var sub = plus.webview.create(subpage[i], subpage[i], style);
					currentWebview.append(sub);
					if (i > 0) {
						sub.hide();
					}
				}
			})

			mui.ready(function() {
				
				mui(".myfooter").on("tap", "a", function(e) {
					
					var currentActiveTab = this.getAttribute("href");
					var activetab = mui(".mui-active")[0].getAttribute("href");
					
					if (currentActiveTab != mui(".mui-active")[0].getAttribute("href")) {
						plus.webview.hide(mui(".mui-active")[0].getAttribute("href")); // 隐藏
						plus.webview.show(currentActiveTab); // 显示
					}
				});
			})
			
		</script>
	</body>

</html>